/**
 * Created by Administrator on 2017/4/28 0028.
 */
$(function () {
   var myscroll;
    function loaded() {
        myscroll=new iScroll("wrapper");
    }
    window.addEventListener("DOMCContentLoaded",loaded,false);

    var mySwiper = new Swiper ('.swiper-container', {
        loop: true,
        // 如果需要分页器
        pagination: '.swiper-pagination',

    })

    $("#alowright").on("click",function () {
        $(".shop_xiangqing").animate({left:'0'})
    })
    $("#allowleft").on("click",function () {
        $(".shop_xiangqing").animate({left:'100%'})
    })

    $(".foot_nav .iconfont").on("click",function(){
        $(this).addClass('active').parent().siblings().children('i').removeClass('active')
    })

    console.log(window.location.hash);
    if(window.location.hash.indexOf("faxian")!=-1){
        $("#faxian").addClass('active').parent().siblings().children('i').removeClass('active')
    }else if(window.location.hash.indexOf("dingdan")!=-1){
        $("#dingdan").addClass('active').parent().siblings().children('i').removeClass('active')
    }else if(window.location.hash.indexOf("mine")!=-1){
        $("#mine").addClass('active').parent().siblings().children('i').removeClass('active')
    }

    $(".merchant").on("click",function(){
        var id=$(this).data("restaraut_id");
        console.log(1);
        window.location.href="html/shop_detail.html?id="+id
    })
})